package exception._5_21;

import java.awt.*;
import java.io.FileNotFoundException;
import java.io.IOException;

public class ThrowsDemo {
    public void doSome()throws IOException, AWTException{

    }
}
class SubClass extends ThrowsDemo{
//    public  void doSome(){};子类重写超类方法时,可以不再抛出异常
//    public void doSome()throws IOException{};
    //允许仅抛出超类方法抛出的部分异常
    public void doSome()throws FileNotFoundException{}//FileNotFoundException extends IOException
    //允许抛出超类方法声明抛出异常的子类型异常
    //不允许抛其他类的异常
}
